﻿<navigation:Page x:Class="PornSite.Views.ManagerPhoto" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
                 xmlns:local="clr-namespace:PornSite.Controls"
           xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="ManagerPhoto Page"
                 Style="{StaticResource PageStyle}" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:PornSite.Web" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    <sdk:Page.Resources>
        <CollectionViewSource x:Key="aspnet_UsersFoldersViewSource" Source="{Binding Path=Data.Folders, ElementName=aspnet_UsersDomainDataSource}" />
    </sdk:Page.Resources>
    <ScrollViewer>
    <Grid x:Name="LayoutRoot" Visibility="Collapsed">
        <local:BusyIndicator 
            IsBusy="{Binding ElementName=aspnet_UsersDomainDataSource, Path=IsBusy}"
            VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                
        
        <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:aspnet_Users, CreateList=true}"
                                      Height="0" LoadedData="aspnet_UsersDomainDataSource_LoadedData" 
                                      Name="aspnet_UsersDomainDataSource" QueryName="GetAspnet_UsersQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my:DomainServicePorn />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        <StackPanel>
                    <ListBox  HorizontalAlignment="Left" DisplayMemberPath="UserName" SelectionChanged="aspnet_UsersListBox_SelectionChanged" ItemsSource="{Binding ElementName=aspnet_UsersDomainDataSource, Path=Data}"  
                  Name="aspnet_UsersListBox" />
            <sdk:DataPager Height="23" HorizontalAlignment="Left"
                Name="dataPagerUsers"
                PageSize="10" VerticalAlignment="Top" Width="187"
                Source="{Binding ElementName=aspnet_UsersDomainDataSource, Path=Data}"/>
        </StackPanel>
        <StackPanel Grid.Column="1"> 
        <sdk:DataGrid AutoGenerateColumns="False" SelectionChanged="foldersDataGrid_SelectionChanged" ItemsSource="{Binding Source={StaticResource aspnet_UsersFoldersViewSource}}" 
                      Name="foldersDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" >
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn x:Name="folderIdColumn" Binding="{Binding Path=FolderId, Mode=OneWay}" Header="Folder Id" IsReadOnly="True" Width="SizeToHeader" />
                <sdk:DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=Name}" Header="Name" Width="SizeToHeader" />
                <sdk:DataGridTextColumn x:Name="userIdColumn" Binding="{Binding Path=UserId}" Header="User Id" Width="SizeToHeader" />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
        </StackPanel>
        <StackPanel Grid.Column="1" Name="editFolders" Visibility="Collapsed" Grid.Row="1">
            <toolkit:DataForm AutoEdit="True" AutoCommit="True" ItemsSource="{Binding Source={StaticResource aspnet_UsersFoldersViewSource}}" ></toolkit:DataForm >
            <Button Name="buttonSaveFolder" Content="Save" Click="ButtonSaveFolder_Click"></Button>
                        <telerik:RadUpload  UploadServiceUrl="/SampleUploadHandler.ashx"
                        Filter="Image Files (*.gif;*.jpg;*.jpeg;*.png)|*.gif;*.jpg;*.jpeg;*.png"/>
                </StackPanel>
                    <telerik:RadGridView IsReadOnly="True" Grid.Column="0" Grid.Row="1"   Name="photoRadGridView" VerticalAlignment="Top" >
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding PhotoDescription}" Header="PhotoDescription"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding IsPrivate}" Header="IsPrivate"/>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>

                </Grid>
        </local:BusyIndicator>
    </Grid>
    </ScrollViewer>
</navigation:Page>
